package com.ridbor001.demo.service;

import com.ridbor001.demo.bean.RDBTeacher;
import com.ridbor001.demo.dao.RDBTeacherDAO;

import java.sql.SQLException;
import java.util.List;
import java.util.Optional;

public class RDBTeacherService {
    RDBTeacherDAO dao = new RDBTeacherDAO();
    public RDBTeacher findTeacherById(String teacherId) throws SQLException {
        return dao.findTeacherById(teacherId);
    }

    public Optional<RDBTeacher> findTeacherByIdAndPassword(String id, String password) throws SQLException {
        return dao.findTeacherByIdAndPassword(id, password);
    }

    public boolean teacherExists(String teacherId) throws SQLException {
        return dao.teacherExists(teacherId);
    }

    public void addTeacher(RDBTeacher user) throws SQLException {
        dao.addTeacher(user);
    }

    public List<RDBTeacher> getAllTeachers() throws SQLException {
        return dao.getAllTeachers();
    }
}
